home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 50
/
Volume 50 - JOGO DISK .iso
/
Games
/
mechacatdestructo.swf
/
scripts
/
frame_7
/
PlaceObject2_320_1171
/
CLIPACTIONRECORD onClipEvent(load).as
Wrap
Text File
|
2007-10-01
|
4KB
|
168 lines
onClipEvent(load){
function getScores()
{
if(G_TestHighScore == true)
{
trace("getScores");
}
if(gProxyObj == undefined)
{
if(G_TestHighScore == true)
{
trace("dans getscore, listescore");
}
listScores();
}
else
{
if(G_TestHighScore == true)
{
trace("dans getscore, getScores");
}
gProxyObj.getScores(cbFunc2);
}
}
function submitScore(theScore)
{
if(G_TestHighScore == true)
{
trace("Envoie le score = " + theScore);
}
gProxyObj.submitScore(theScore,cbFunc);
}
function initHiScores()
{
if(G_TestHighScore == true)
{
trace("Tu init le highscore!");
}
gProxyObj.setGame_Id("cs_destructo");
}
function getScoreString()
{
var _loc5_ = "Oops! The high score list isn\'t available right now!";
var _loc8_ = 30;
if(gProxyObj != undefined)
{
var _loc7_ = gProxyObj.getScoreCount();
if(_loc7_ > 0)
{
var _loc1_ = undefined;
var _loc6_ = undefined;
var _loc3_ = undefined;
var _loc4_ = undefined;
_loc5_ = "";
_loc1_ = 0;
while(_loc1_ < _loc7_)
{
_loc6_ = gProxyObj.getScoreItem(_loc1_);
_loc3_ = _loc6_[0];
_loc4_ = fStyleNumber(_loc6_[1]);
spaceNb = _loc8_ - _loc3_.length - _loc4_.length - 4;
spaceTXT = "";
var _loc2_ = 0;
while(_loc2_ < spaceNb)
{
spaceTXT += " ";
_loc2_ = _loc2_ + 1;
}
if(_loc1_ < 9)
{
_loc5_ += _loc1_ + 1 + " " + _loc3_ + spaceTXT + _loc4_ + "\n";
}
else if(_loc1_ < 99)
{
_loc5_ += _loc1_ + 1 + " " + _loc3_ + spaceTXT + _loc4_ + "\n";
}
else
{
_loc5_ += _loc1_ + 1 + " " + _loc3_ + spaceTXT + _loc4_ + "\n";
}
_loc1_ = _loc1_ + 1;
}
}
else
{
_loc5_ = "Whoops, the high scores seem to have escaped!";
}
}
if(G_TestHighScore == true)
{
trace("Tu retournes ça = " + _loc5_);
}
return _loc5_;
}
function listScores()
{
if(G_TestHighScore == true)
{
trace("Liste les scores..");
}
_parent.txt_highScore.text = getScoreString();
}
function cbFunc(thisBool)
{
if(thisBool)
{
listScores();
}
else
{
if(G_TestHighScore == true)
{
trace("CBfunc yé false...");
}
_parent.txt_highScore.text = "Oops! The high score list isnΓÇÖt available right now!";
}
}
function cbFunc2(thisBool)
{
if(thisBool)
{
listScores();
}
else
{
_parent.txt_highScore.text = "Oops! The high score list isnΓÇÖt available right now!";
}
}
function fStyleNumber(_nNumber, _nMinimumChar)
{
_sNumber = String(_nNumber);
_sNewString = "";
_nlength = _sNumber.length;
_nlength /= 3;
if(_nlength <= 1)
{
_sNewNumber = _sNumber;
if(_sNewNumber.length < _nMinimumChar)
{
_sNewNumber = "0" + _sNewNumber;
}
return _sNewNumber;
}
_nLoop = _nlength;
while(_nLoop > 1)
{
_sNewString = " " + _sNumber.substr(-3) + _sNewString;
_sNumber = _sNumber.substr(0,-3);
_nLoop--;
}
_sNewNumber = _sNumber + _sNewString;
if(_sNewNumber.length < _nMinimumChar)
{
_sNewNumber = "0" + _sNewNumber;
}
return _sNewNumber;
}
_global.HS = this;
var G_ShowHighScore = true;
var G_TestHighScore = false;
if(G_TestHighScore == true)
{
gProxyObj.setServer("www.nick-q.mtvi.com");
gProxyObj.setScreenName("DanQuiTest");
gProxyObj.setIsLoggedIn(true);
}
}